package com.queue.server.web.controller;

import com.alibaba.fastjson.JSON;
import com.queue.server.web.service.DataChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mini/message/queue/data")
public class DataController {
    @Autowired
    DataChartService dataChartService;

    /**
     * 可视化图表，队列数据概览接口
     * @return
     */
    @GetMapping("/queue")
    public String queueCharts(){
        return JSON.toJSONString(dataChartService.queueData());
    }

    @GetMapping("/list")
    public String queueDetail(){
        return JSON.toJSONString(dataChartService.queueDetail());
    }
}
